/**
 * 
 */
package org.intelligentsia.artifacts.repository;

import java.util.StringTokenizer;

import org.intelligentsia.artifacts.ArtifactIdentifier;


/**
 * @author geronimo
 *
 */
public class Resolver {

	
	public String resolve(ArtifactIdentifier identifier) {
		StringBuilder builder = new StringBuilder();
		// tokenize groupId
		StringTokenizer  tokenizer = new StringTokenizer(identifier.getGroupId(), ".");
		while(tokenizer.hasMoreTokens()) {
			builder.append(tokenizer.nextToken()).append("/");
		}
		// artifact id
		builder.append(identifier.getArtifactId()).append("/");
		//version
		builder.append(identifier.getVersion()).append("/");
		
		return builder.toString();
	}
}
